cmake_minimum_required(VERSION 3.20.2)
project(cJSONTest VERSION 1.0)

set(CMAKE_INSTALL_BINDIR "${CMAKE_CURRENT_SOURCE_DIR}/build/bin")

include(ProcessorCount)
ProcessorCount(CPU_CORE_COUNT)
math(EXPR PROCESSOR_COUNT "${CPU_CORE_COUNT} - 2")
message("[INFO]PROCESSOR_COUNT: ${PROCESSOR_COUNT}")

message("[INFO]${CMAKE_CURRENT_SOURCE_DIR}")

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../")

file(GLOB SOURCE_FILES
	"*.c"
    "*.cpp"
	"../../*.c"
)
message("[INFO]${SOURCE_FILES}")
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})